<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ page import="dtt.DefectBean" %>
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'Content_template.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<script language="javascript">
	function submitForm(projectno, defectno) {
	  window.viewdefectform.defectId.value=defectno;
	  window.viewdefectform.projectId.value=projectno;
	  window.viewdefectform.submit();
	}
	</script>
  </head>
  
  <body>
  <br>
  <form id="viewdefectform" method= "post" action="servlet/FrontController">  
  <input type="hidden" name="DTT_ACTION" value="VIEW_DEFECT">
  <input type="hidden" name="defectId" value=""> 
  <input type="hidden" name="projectId" value="">  
    <table valign="top" border="1" align="center" width="85%">
      <tr>
      <th>ProjectId</th><th>DefectId</th>
      <th>Defect Description</th><th>Severity</th><th>Status</th>
       </tr>
      <tr>
      <!-- <td><a href="servlet/FrontController?DTT_ACTION=VIEW_DEFECT&defectId=123">123</td> -->
      <%--<td><a href="javascript:submitForm('123')">123</td>
      
       --%>
       <%
    
    ArrayList defectList= new ArrayList();
    DefectBean defect = null;
   // if(request.getSession().getAttribute("userbean") != null)
    if(request.getAttribute("defectList") != null){
        defectList = (ArrayList)request.getAttribute("defectList");
        Iterator itr = defectList.iterator();
        while(itr.hasNext()){
        defect = (DefectBean)itr.next();
        %>
        <tr> 
        <td> <%= defect.getProjectId() %> </td>
        <td><a href="servlet/FrontController?DTT_ACTION=VIEW_DEFECT&projectId=<%=defect.getProjectId()%>&defectId=<%=defect.getDefectId()%>"/> <%= defect.getDefectId() %> </a></td>
        
        <td> <%= defect.getDefectDesc() %> </td>
        <td> <%= defect.getDefectSeverity() %> </td>
        <td> <%= defect.getDefectStatus() %> </td>
             
        </tr>
        
        
        <%
        } //end while
     } //end if
    else {
    System.out.println("NULL value for defectlist");
    }
       %>
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      <%--<td>Mail not delivered to all recepients</td>
            <td>Critical</td>
                  <td>High</td>
                        <td>Open</td>
                              <td>Developer1</td>
                                    <td>02/17/2007</td>
      </tr>
      <tr>
      <td><a href="">124</td>
      <td>Inbox scrollbar not displayed</td>
            <td>Critical</td>
                  <td>High</td>
                        <td>Open</td>
                              <td>Developer2</td>
                                    <td>02/17/2007</td>
      </tr>
      <tr>
      <td><a href="">125</td>
      <td>NewFolder option shows runtime error</td>
            <td>Critical</td>
                  <td>High</td>
                        <td>Open</td>
                              <td>Developer1</td>
                                    <td>02/17/2007</td>
      </tr>
      <tr>
      <td><a href="">126</td>
      <td>Contacts list does not check for unique contact name</td>
            <td>Critical</td>
                  <td>High</td>
                        <td>Open</td>
                              <td>Developer2</td>
                                    <td>02/17/2007</td>
      </tr>
      <tr>
      <td><a href="">127</td>
      <td>Mail not delivered to all recepients</td>
            <td>Critical</td>
                  <td>High</td>
                        <td>Open</td>
                              <td>Tester1</td>
                                    <td>02/17/2007</td>
      </tr>
      <tr>
      <td><a href="">128</td>
      <td>Mail not delivered to all recepients</td>
            <td>Critical</td>
                  <td>High</td>
                        <td>Open</td>
                              <td>Tester1</td>
                                    <td>02/17/2007</td>
      </tr>
    </table>
--%>
</table>
</form>
  </body>
</html>
	